package com.teacher.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.teacher.pojo.dto.student.StudentGetDto;
import com.teacher.pojo.entity.PerStudent;
import com.teacher.pojo.vo.student.StudentGetVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zfm
 * @since 2021-06-15
 */
public interface PerStudentMapper extends BaseMapper<PerStudent> {

    IPage<StudentGetVo> getPage(@Param("page") Page<StudentGetVo> page, @Param("dto") StudentGetDto dto);

    /**
     * 根据工号获取姓名
     *
     * @param studentKey
     * @return
     */
    String getNameByStudentKey(@Param("studentKey") String studentKey);

    /**
     * 查询是否是体育专业
     *
     * @param studentKey
     * @return
     */
    Boolean isPe(@Param("studentKey") String studentKey);

    /**
     * 查询班级id
     *
     * @param studentKey
     * @return
     */
    Long getClassIdByStudentKey(@Param("studentKey") String studentKey);

    /**
     * 查询所有学生信息
     *
     * @param name
     * @return
     */
    List<PerStudent> getListAll(@Param("name") String name);

    /**
     * 就只查询自己班级信息
     *
     * @param name
     * @return
     */
    List<PerStudent> getListByTeacherKey(@Param("name") String name, @Param("teacherKey") String teacherKey);
}
